package cn.mado.org.service.impl;

import cn.mado.basic.query.BaseQuery;
import cn.mado.org.domain.Movie;
import cn.mado.org.mapper.MovieMapper;
import cn.mado.org.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
@Service
public class MovieServiceImpl implements MovieService {
    @Autowired
    private MovieMapper movieMapper;

    @Override
    public List<Movie> findMovieAll() {
        return movieMapper.findMovieAll();
    }

    @Override
    public List<Movie> findMovie(BaseQuery baseQuery) {
        return movieMapper.findMovie(baseQuery);
    }

    @Override
    public Integer findMovieTotals(BaseQuery baseQuery) {
        return movieMapper.findMovieTotals(baseQuery);
    }

    @Override
    public void delMovieByid(Long novelId) {
        movieMapper.delMovieByid(novelId);
    }

    @Override
    public void addMovie(Movie movie) {
        movie.setCreatetime(new Date());
        movieMapper.addMovie(movie);
    }

    @Override
    public void updataMovie(Movie movie) {
        movieMapper.updataMovie(movie);
    }
}
